UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4S76FXo7r1S5moPzB0W/VvfCd9RBS5hsz4uiiLYq95w='
WHERE
key_id = 'e64b417cf9a250aa214c1077395cafcb37db48c830e8819831a6500e8cbe81e4'
AND (
token = '4S76FXo7r1S5moPzB0W/VvfCd9RBS5hsz4uiiLYq95w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)