UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AWuLrdJR4XuM/zn+zHaiUN9F3dzwQwpdTEnOK4bTJDA='
WHERE
key_id = '3b785e9e964450d022689be63e2a52f8168d3dfe5497de88e937f0c3927ed72e'
AND (
token = 'AWuLrdJR4XuM/zn+zHaiUN9F3dzwQwpdTEnOK4bTJDA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)