UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wERUCL18wF7IvnTFDYd9LLgae5jyUeGgD+Q5idzXw74='
WHERE
key_id = '9ee29c6d4b7e95942fb519df13064baf5312b723910397bb5f6fdbc30defb505'
AND (
token = 'wERUCL18wF7IvnTFDYd9LLgae5jyUeGgD+Q5idzXw74='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)