UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TSsSwkd+UEOx0n3TnS9YKSn+Y5Ufk7DvctVOgQgRLMw='
WHERE
key_id = '84e9442c26b1e2d306e06372af10667f5b50557c7d14e6e54244639c3c7721c5'
AND (
token = 'TSsSwkd+UEOx0n3TnS9YKSn+Y5Ufk7DvctVOgQgRLMw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)