UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qYQPOemct59TruOAHNYdxwtClvbI6xqcMHMJETDB6BU='
WHERE
key_id = '9554232188984dfcd7f8513ad3b22b217dbe9e09f24f66841582bce908bfb8fd'
AND (
token = 'qYQPOemct59TruOAHNYdxwtClvbI6xqcMHMJETDB6BU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)