UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/Eqi52ZWZuqUHTckBehKhpS5YSotB4sfhca3JSw/mcY=' 
WHERE 
  key_id = '871da3d08edbaa1dc01fb0952eab051d6b5556fb4c4740696becad34e06c272c' 
  AND (
    token = '/Eqi52ZWZuqUHTckBehKhpS5YSotB4sfhca3JSw/mcY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019