UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7xUAd2rEQuoI0q2rJSd5lnGdOqNUKGOuSfvXFjKwU/0='
WHERE
key_id = 'b8c4d2bdedbbef889cac5acd9abf3e65216051af3bf2f25b99ccb0f50cc1cc25'
AND (
token = '7xUAd2rEQuoI0q2rJSd5lnGdOqNUKGOuSfvXFjKwU/0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)