UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 't1MMExG/adHypOPlh9toQATAsKZNCPyWuL3O32r6Y+8=' 
WHERE 
  key_id = 'd204fa3f4849cbb85d14a2ecd62449d1d2d6329566c0080676832aeaddc7a2db' 
  AND (
    token = 't1MMExG/adHypOPlh9toQATAsKZNCPyWuL3O32r6Y+8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044