UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bt+Fd8uFzU50fzTW0yc4XLd9rUgNY9G/W6ev5e+1qNk='
WHERE
key_id = 'c9b7b1428ddb9cb02d54ece23f435b4ad7d6abd8c911e98d396df2dafe879b73'
AND (
token = 'bt+Fd8uFzU50fzTW0yc4XLd9rUgNY9G/W6ev5e+1qNk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)