UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'M+aziTGRFm5Cvn9bf1d/GJkAgCDKWRc7LcSUBu0r6pQ=' 
WHERE 
  key_id = '204f972d58d927d1f2384c4860b6f7b15b44f01f0bbf5731a4d58cb560d95a5a' 
  AND (
    token = 'M+aziTGRFm5Cvn9bf1d/GJkAgCDKWRc7LcSUBu0r6pQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037