UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zKU8CnliodUfNoC0ObzPr3mBUpPrIaovgzyuJ/RncM4='
WHERE
key_id = '2ee48f312425d496eb912e161cee99eb3de091fccfd6e6936d3f7ee61340fae0'
AND (
token = 'zKU8CnliodUfNoC0ObzPr3mBUpPrIaovgzyuJ/RncM4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)