UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4uABnYPbXunVDP5dZhrvDwnM3I3mlebUYxpObF6yjHg='
WHERE
key_id = '03bcae2d3697f3c4d4c01b66235f64ea0fe0210feb99540d0f09a3697ac19824'
AND (
token = '4uABnYPbXunVDP5dZhrvDwnM3I3mlebUYxpObF6yjHg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)