UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'b9eHPsAiMf4Y9bsjUrdUaFPw/vTOLRm8SVZrrRAJ3UY=' 
WHERE 
  key_id = '7ee0d77efe73d6f9ec0eb09b42b391c036822a62ab778129b3e4995caa999f42' 
  AND (
    token = 'b9eHPsAiMf4Y9bsjUrdUaFPw/vTOLRm8SVZrrRAJ3UY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019