UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WsCktlFmPzNb2Ty934pjyNLQWOyHfIIbI0c/g7XWK6U='
WHERE
key_id = '108e06b6bb820455406730b563fcbc037ab076575ce9ede5c5bae8337ce05f00'
AND (
token = 'WsCktlFmPzNb2Ty934pjyNLQWOyHfIIbI0c/g7XWK6U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)