UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JXbr4qWuoKjmNMg0apnhoITmEUfe9HsEIUP/pS8r54w=' 
WHERE 
  key_id = '9c703f13ebcb4e38286fe6a6e81198ce1847f50fb415dec26d16538aa8325c7e' 
  AND (
    token = 'JXbr4qWuoKjmNMg0apnhoITmEUfe9HsEIUP/pS8r54w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022