UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pgusegO3VxE1WWnxOigU+XKXdUrOKLVJ0u4qZrxsmPI='
WHERE
key_id = '9de5a222fdb78fc219d4048b580f7e30f71dff86d214982a4c36d3316ef00280'
AND (
token = 'pgusegO3VxE1WWnxOigU+XKXdUrOKLVJ0u4qZrxsmPI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)