UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jcsF5ChFzFS0Tinly+LFlLSCfk/J/xF4NkV7qYJ3NK0=' 
WHERE 
  key_id = 'fb79fba8f24750726ce8c16251737163737421d07fff029f60c3105b6bad547b' 
  AND (
    token = 'jcsF5ChFzFS0Tinly+LFlLSCfk/J/xF4NkV7qYJ3NK0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022