UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'l/t4kVeZpIDpbjGniRVsqjuhw4DdZ3KoXHVgL/4aPRs=' 
WHERE 
  key_id = 'dc30dfec5bf00ae5ae83d022f74ed3ec1b83c0145e6a17c1e811bca081e3a3ad' 
  AND (
    token = 'l/t4kVeZpIDpbjGniRVsqjuhw4DdZ3KoXHVgL/4aPRs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00090