UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WIo5vrgkChISzjuCrZ3/B3t2jl5unDEual8GtIaV5RQ=' 
WHERE 
  key_id = '97d7b3fef1597f785f6d0453cdc71fd32bd0e4f4e9a361ec0ec408a2c0d2151d' 
  AND (
    token = 'WIo5vrgkChISzjuCrZ3/B3t2jl5unDEual8GtIaV5RQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037