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