UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4Fj1em3D13bB0xx2NUDrZTeg8AQjykYW1zPRtdTa7K8=' 
WHERE 
  key_id = 'f68aaa6a35a6ecfc0d860869a8b0925350891d3949eb09606702afc21f6a4ec8' 
  AND (
    token = '4Fj1em3D13bB0xx2NUDrZTeg8AQjykYW1zPRtdTa7K8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044