UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PQQHDjrXogWHUqcu+OfrGQpqj+ge84jD6sV6Ja5Rtaw='
WHERE
key_id = '4d9a3bf611b4a416a4d3e12671ca2474617702133d0be3cd60b2a1a91c77df37'
AND (
token = 'PQQHDjrXogWHUqcu+OfrGQpqj+ge84jD6sV6Ja5Rtaw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)