UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'omhPyFeBIBi20eUP9g91EWui/+n6UX9VXJPuwza8xC0=' 
WHERE 
  key_id = '049d3a510e729d1f2b62ac8ee55611852075beac059d45bbf3b6e4d70fd36421' 
  AND (
    token = 'omhPyFeBIBi20eUP9g91EWui/+n6UX9VXJPuwza8xC0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044