UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Xm8Klya3wZVYN4As1bBJjc881WP3tu8XZRY3nK9UZFg='
WHERE
key_id = '4acec656bede54abfea8aa4ed0316c02a7dab690b67ea9f892e59aade0c21aea'
AND (
token = 'Xm8Klya3wZVYN4As1bBJjc881WP3tu8XZRY3nK9UZFg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)