UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Fvdz9TDYp/kbrKf5xjvha7u6DovPaGwk07u7iHvR2LI='
WHERE
key_id = 'fa4daaafc6b46ee4bdae6040a515c5dd356a9c8c88095c4742d145c3e6895aff'
AND (
token = 'Fvdz9TDYp/kbrKf5xjvha7u6DovPaGwk07u7iHvR2LI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)