UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QvXtef4cLC4S76NnMUYe+L7GLNqnIWavGcTwNiPG98Y='
WHERE
key_id = '363e43f3463ce48586c57d30c4c3fe41ec36f08cfc9bc2177e9ac7112317a8e2'
AND (
token = 'QvXtef4cLC4S76NnMUYe+L7GLNqnIWavGcTwNiPG98Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)