UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'R1BW+O4MIVRHuvtwTjaQaldzW7xcKMuOI8HbdtB0T70='
WHERE
key_id = '2e75970cf9ff892ad9ac5e86ea5ee6d5edd5deb101ef907a847cddfaddc426d6'
AND (
token = 'R1BW+O4MIVRHuvtwTjaQaldzW7xcKMuOI8HbdtB0T70='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)