UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wbItc4L+vUxYnZWhI8EZxR2zBEijLl5vD9aR1HDpkeA='
WHERE
key_id = '6224bcc538910fa89f6230dcc4fea8ea00b0a3ce6485c321a8f2226a6f924036'
AND (
token = 'wbItc4L+vUxYnZWhI8EZxR2zBEijLl5vD9aR1HDpkeA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)