UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4ubj0d9cuioRT1iW6ZNEb9/qQeCnaXVZG9/cu2sevA4=' 
WHERE 
  key_id = 'c5bf92224f21812d5859d9eb4af321ae92f23e84bc117599516ad6752fc26f4c' 
  AND (
    token = '4ubj0d9cuioRT1iW6ZNEb9/qQeCnaXVZG9/cu2sevA4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00086