UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MMUZaWBxKp1RTLtRuw474BVV/x5euC8p/8YZ84yzLRY='
WHERE
key_id = '620a13ad8d226078ec5d853160419fc33bac83ff26ef4762fe914b81114e5527'
AND (
token = 'MMUZaWBxKp1RTLtRuw474BVV/x5euC8p/8YZ84yzLRY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)