UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fU4WubhIbueIOuEWELWFR82YRoe9zaqY0AQWPcloQkA=' 
WHERE 
  key_id = '56ff9346b155c28b1d8dc6daae70386081a5eed1272b932b1169ae0e5ccbacae' 
  AND (
    token = 'fU4WubhIbueIOuEWELWFR82YRoe9zaqY0AQWPcloQkA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039