UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6ufv+C4RKFZqUfZHWwBbeXsqsu30q/5sM9cOck1BwYo='
WHERE
key_id = '1be52b10b43f04e184eade83cf02c570c7cca4ad60723378c664fed86ec7d65a'
AND (
token = '6ufv+C4RKFZqUfZHWwBbeXsqsu30q/5sM9cOck1BwYo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)