UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9nrxzdBAzkIoKYX298Kq4YVjXLiJp3K/lf6aq5tx87k='
WHERE
key_id = 'a1b43552c1efb05713bf5b61db6a0d1cb0b7fc802d8ef5ec0026e416fcdd3e49'
AND (
token = '9nrxzdBAzkIoKYX298Kq4YVjXLiJp3K/lf6aq5tx87k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)