UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zi7bJ65cMD23Kf/onY048MEWpLlNnDQHk7XwkzKt/os='
WHERE
key_id = 'd41ff3e8a9d7407da34b3010e4c09ff3b7252310e5786bd770d6e4aa6c48af78'
AND (
token = 'zi7bJ65cMD23Kf/onY048MEWpLlNnDQHk7XwkzKt/os='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)