UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tGIcE+CzpBXslmhkTW88wS+foa3qApjjU/WnoEXzqUo='
WHERE
key_id = '28879d7b22ec63719e3e91a90c5842a88e11daeca799de7167c25d697796798c'
AND (
token = 'tGIcE+CzpBXslmhkTW88wS+foa3qApjjU/WnoEXzqUo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)