UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'op3uZTuLwg0dSF0ZDUGcuAu4PI/t/Fx5alGeoGYqZ+g=' 
WHERE 
  key_id = 'd1dbc0249269a644c38797987291d0a8a8787cec20b799718def4954d72c4263' 
  AND (
    token = 'op3uZTuLwg0dSF0ZDUGcuAu4PI/t/Fx5alGeoGYqZ+g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034