UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'r2LFDGOMVMsipIkufwzzRpEl5uH4lfH4vRr9tSZNi/Y=' 
WHERE 
  key_id = 'cdfdacfdd4964e330c7c5b80cff3106c12883d9aa0f6e59b1ab3840f01e3b486' 
  AND (
    token = 'r2LFDGOMVMsipIkufwzzRpEl5uH4lfH4vRr9tSZNi/Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052