UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'o+RWsc+LpnXTgooC1vcJJgsU7D53B0rbr6pHK0WKKIA='
WHERE
key_id = '622a1671e9a553d9611885b9d975463a7988bb3194b56f7a1a2313aaa330b595'
AND (
token = 'o+RWsc+LpnXTgooC1vcJJgsU7D53B0rbr6pHK0WKKIA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)