UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ibx/FiBuDGS6St3jv81Q31ixEOfav4wn2xOVrf+4vyo='
WHERE
key_id = '4397a9a25bfdbc6248811291246db1cf315fbad98dd711fce4a3a6b7dce3334d'
AND (
token = 'ibx/FiBuDGS6St3jv81Q31ixEOfav4wn2xOVrf+4vyo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)