UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6wtz3JkMdRlnJKIyPr3IsGNOHs4WkhdEdYLzMJa+OxQ='
WHERE
key_id = '83689d35f6e7f08efcde334779d717a278a1891ad5c6a8da1076008a14b934c0'
AND (
token = '6wtz3JkMdRlnJKIyPr3IsGNOHs4WkhdEdYLzMJa+OxQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)