UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AgumBRHLeWR9fgA4G9HdsqxBvpXn7SgmZxnUaAm1d08='
WHERE
key_id = '24b9ee0a0bc5334e544bc912b04fdcc1b5ae4f0d48efea37428ee97231bb36c6'
AND (
token = 'AgumBRHLeWR9fgA4G9HdsqxBvpXn7SgmZxnUaAm1d08='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)