UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yZ7VCkqPoyRw0eESoTq1+5UC9acgptcOnXCPOd/6YhA='
WHERE
key_id = '88c1a7a32637d53b1b5fae8ea6fd2ff5447539a200ccdfabf8583f82ef6f7406'
AND (
token = 'yZ7VCkqPoyRw0eESoTq1+5UC9acgptcOnXCPOd/6YhA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)