UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HfTQfZ0Out6Xv+Y8qwf1Y6NS2gyidOdRcN4qBNqjK8A='
WHERE
key_id = '0c4c757f3b6ff06dadf7fb39579329d5a0b4d511fc64fdffe19ca782a5363047'
AND (
token = 'HfTQfZ0Out6Xv+Y8qwf1Y6NS2gyidOdRcN4qBNqjK8A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)