UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zC8lwp02MJxW5XwCeGUVwwnM2ppc7Ps+65yrbbjEWxs='
WHERE
key_id = '743f2c66bd119901c1f06f03ae1662f9f9cd374b51e8a3e84365e059f9aa5186'
AND (
token = 'zC8lwp02MJxW5XwCeGUVwwnM2ppc7Ps+65yrbbjEWxs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)