UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ThTWzc1h6cdGO8FBVeRn/vce8ouSEnTrPvh6OkwM6mg='
WHERE
key_id = '39efcd27f00a246929ae742e236fe94837417183331f07c6bf2ed636f2ecc4c0'
AND (
token = 'ThTWzc1h6cdGO8FBVeRn/vce8ouSEnTrPvh6OkwM6mg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)