UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zlL0Q6Pyv4v7w83MDW5gpabBSu23FMp9RGe2Bb7aHpc=' 
WHERE 
  key_id = '468dd7ccd538da1c2c3e7b4755c63c36828a4aa8a244e0d2e400c637b3d58cbd' 
  AND (
    token = 'zlL0Q6Pyv4v7w83MDW5gpabBSu23FMp9RGe2Bb7aHpc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030