UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QPwOu9Zm/3c1LGb63ioyg0P0GWpOWHKDlYPaoO/8BK0='
WHERE
key_id = 'bb970133bfeffc8e1e7a80dbe3a403e5a3852fc524b1901f65d87ceabce93100'
AND (
token = 'QPwOu9Zm/3c1LGb63ioyg0P0GWpOWHKDlYPaoO/8BK0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)