UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EgePqbZAVl3Xo/dfOQ+mMXu/ynpV+bD/3qnXllQI5ko=' 
WHERE 
  key_id = '4851528c52869900d78b6e06a24c330ad5d9af483a3e64ebc88a4a2dd483768f' 
  AND (
    token = 'EgePqbZAVl3Xo/dfOQ+mMXu/ynpV+bD/3qnXllQI5ko=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032