UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9CgpgyrsOXA5CfESm88wKOsUAyfwzUgzUybagHOmuR4='
WHERE
key_id = 'a09467bac078c8242838429205daea41a1c3d21b706753a6390f806b8bf1aca3'
AND (
token = '9CgpgyrsOXA5CfESm88wKOsUAyfwzUgzUybagHOmuR4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)