UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qm1PnebOCB+2uLD/D6fVniAxIi442jcdxXEn7yxwqJM='
WHERE
key_id = 'f03fc1033b8e19889331988855306fef3355d3427b2d7b3e17b129e924784763'
AND (
token = 'qm1PnebOCB+2uLD/D6fVniAxIi442jcdxXEn7yxwqJM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)