UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'A/6tL+8OWigafrKWrj/YEEeFQyTBuojVety2246h608='
WHERE
key_id = '15bda7c5b996319fdc51d012d44a98fc2ac6e6f7ad3cbb663cc61eef9d899503'
AND (
token = 'A/6tL+8OWigafrKWrj/YEEeFQyTBuojVety2246h608='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)