UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GYSNztKt2oaGWipaGMHHhJTACgvl+FRfdRFyHaw+3wA='
WHERE
key_id = 'f48f1e2aae375f9f0a78124c228e97ae0d704d6e763f3c9d70667f4a6b210225'
AND (
token = 'GYSNztKt2oaGWipaGMHHhJTACgvl+FRfdRFyHaw+3wA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)