UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZH5Rm9emF3y5cbWUNjaXGEzeWA43X4mb9OC++SWVvhY='
WHERE
key_id = '6f001780548c0d1d53180ed518e061709cddb547805b1b958af3e6b14b930d16'
AND (
token = 'ZH5Rm9emF3y5cbWUNjaXGEzeWA43X4mb9OC++SWVvhY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)