UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MRbWhVhbdmGcLpNuAMvmrnoBTCTl1XhynEN3hmqaozw=' 
WHERE 
  key_id = '35fb12eecdc7f748ef96716adf5679ae0dceb36d58700f93308f6d001c8a60ab' 
  AND (
    token = 'MRbWhVhbdmGcLpNuAMvmrnoBTCTl1XhynEN3hmqaozw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016